SQL Interview Questions and Answers
Ques 26. What are the two components of ODBC ?
1. An ODBC manager/administrator and
2. ODBC driver.
Ques 27. What is the function of a ODBC manager ?
The ODBC Manager manages all the data sources that exists in the system.
Ques 28. What is the function of a ODBC Driver ?
The ODBC Driver allows the developer to talk to the back end database.
Ques 29. What description of a data source is required for ODBC ?
The name of the DBMS, the location of the source and the database dependent information.
Ques 30. How to Retrieve Warnings?
SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on the calling object
SQLWarning warning = stmt.getWarnings();
if (warning != null)
{
while (warning != null)
{
System.out.println("Message: " + warning.getMessage());
System.out.println("SQLState: " + warning.getSQLState());
System.out.print("Vendor error code: ");
System.out.println(warning.getErrorCode());
warning = warning.getNextWarning();
}
}
Most helpful rated by users: